package com.git.groovy.service;

import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public abstract class MyTestService {

    protected Logger log = LoggerFactory.getLogger(this.getClass());

    /**
     * groovy时，该属性得为public或protected,不然要在子类中用改属性，就得在了类中重新注入
     */
    @Autowired
    protected HelloService helloService;

    public abstract String sayHello(String str);

    public String testHello(String str){
        log.info("testHello");
        System.out.println("testHello");
        String ss = this.sayHello(str);
        System.out.println(ss);
        return helloService.sayHello(str);
    }

}
